/*
 * Update.java
 *
 * Created on __DATE__, __TIME__
 */

package WindowsModule;

import java.sql.Date;
import java.util.Arrays;
import java.util.List;

import javax.swing.JOptionPane;
import javax.swing.SwingConstants;

import Client.ClientListener;
import Client.MsgEvent;
import Tools.ToCenter;
import Windows.MainWindows;

/**
 * 
 * @author __USER__
 */
public class Update extends javax.swing.JFrame implements ClientListener {
	/**
	 * @param args
	 *            the command line arguments
	 */
	public static void main(String args[]) {
		java.awt.EventQueue.invokeLater(new Runnable() {
			@Override
			public void run() {
				new Update().setVisible(true);
			}
		});
	}

	public String id;

	private boolean myinfo;

	// GEN-BEGIN:variables
	// Variables declaration - do not modify
	public javax.swing.JButton jButton1;

	public javax.swing.JButton jButton2;

	public javax.swing.JButton jButton3;

	public javax.swing.JButton jButton4;

	private javax.swing.JCheckBox jCheckBox1;

	private javax.swing.JCheckBox jCheckBox2;

	private javax.swing.JCheckBox jCheckBox3;

	private javax.swing.JCheckBox jCheckBox4;

	private javax.swing.JCheckBox jCheckBox5;

	private javax.swing.JComboBox jComboBox1;

	private javax.swing.JComboBox jComboBox3;
	private javax.swing.JLabel jLabel1;
	private javax.swing.JLabel jLabel10;
	private javax.swing.JLabel jLabel11;
	private javax.swing.JLabel jLabel12;
	private javax.swing.JLabel jLabel13;
	private javax.swing.JLabel jLabel14;
	private javax.swing.JLabel jLabel15;
	private javax.swing.JLabel jLabel16;
	private javax.swing.JLabel jLabel17;
	private javax.swing.JLabel jLabel18;
	private javax.swing.JLabel jLabel19;
	private javax.swing.JLabel jLabel2;
	private javax.swing.JLabel jLabel20;
	private javax.swing.JLabel jLabel21;
	private javax.swing.JLabel jLabel22;
	private javax.swing.JLabel jLabel23;
	private javax.swing.JLabel jLabel3;
	private javax.swing.JLabel jLabel4;
	private javax.swing.JLabel jLabel5;
	private javax.swing.JLabel jLabel6;
	private javax.swing.JLabel jLabel7;
	private javax.swing.JLabel jLabel8;
	private javax.swing.JLabel jLabel9;
	private javax.swing.JPanel jPanel1;
	public final javax.swing.JPanel jPanel2 = new javax.swing.JPanel();
	private javax.swing.JPanel jPanel3;
	private javax.swing.JPasswordField jPasswordField1;
	private javax.swing.JPasswordField jPasswordField2;
	private javax.swing.JScrollPane jScrollPane1;
	private javax.swing.JTabbedPane jTabbedPane1;
	private javax.swing.JTextArea jTextArea1;
	private javax.swing.JTextField jTextField1;
	private javax.swing.JTextField jTextField10;
	private javax.swing.JTextField jTextField2;
	private javax.swing.JTextField jTextField3;
	private javax.swing.JTextField jTextField4;
	private javax.swing.JTextField jTextField5;
	private javax.swing.JTextField jTextField6;
	private javax.swing.JTextField jTextField7;
	private javax.swing.JTextField jTextField8;
	private javax.swing.JTextField jTextField9;
	public Update() {
		initComponents();

		MainWindows.getInstance().client.addClientListenser(this);

		ToCenter.ToCenter(this);

		getinit();

	}
	@Override
	public void dispose() {
		MainWindows.getInstance().client.removeClientListenser(this);
		super.dispose();
	}
	/** Creates new form Update */

	public void getinit() {
		MainWindows.getInstance().client.send("<zhuce cmd=\"shen\" update=\"true\" />");

	}
	/**
	 * This method is called from within the constructor to initialize the form.
	 * WARNING: Do NOT modify this code. The content of this method is always
	 * regenerated by the Form Editor.
	 */
	// GEN-BEGIN:initComponents
	// <editor-fold defaultstate="collapsed" desc="Generated Code">
	private void initComponents() {

		jPanel1 = new javax.swing.JPanel();
		jTabbedPane1 = new javax.swing.JTabbedPane();
		jPanel3 = new javax.swing.JPanel();
		jLabel7 = new javax.swing.JLabel();
		jLabel8 = new javax.swing.JLabel();
		jTextField3 = new javax.swing.JTextField();
		jComboBox1 = new javax.swing.JComboBox();
		jLabel9 = new javax.swing.JLabel();
		jTextField4 = new javax.swing.JTextField();
		jLabel10 = new javax.swing.JLabel();
		jTextField5 = new javax.swing.JTextField();
		jLabel11 = new javax.swing.JLabel();
		jTextField6 = new javax.swing.JTextField();
		jLabel12 = new javax.swing.JLabel();
		jLabel13 = new javax.swing.JLabel();
		jCheckBox1 = new javax.swing.JCheckBox();
		jCheckBox2 = new javax.swing.JCheckBox();
		jCheckBox3 = new javax.swing.JCheckBox();
		jCheckBox4 = new javax.swing.JCheckBox();
		jCheckBox5 = new javax.swing.JCheckBox();
		jLabel14 = new javax.swing.JLabel();
		jTextField7 = new javax.swing.JTextField();
		jLabel15 = new javax.swing.JLabel();
		jLabel16 = new javax.swing.JLabel();
		jLabel17 = new javax.swing.JLabel();
		jComboBox3 = new javax.swing.JComboBox();
		jLabel18 = new javax.swing.JLabel();
		jLabel19 = new javax.swing.JLabel();
		jLabel20 = new javax.swing.JLabel();
		jTextField9 = new javax.swing.JTextField();
		jLabel21 = new javax.swing.JLabel();
		jScrollPane1 = new javax.swing.JScrollPane();
		jTextArea1 = new javax.swing.JTextArea();
		jButton3 = new javax.swing.JButton();
		jButton4 = new javax.swing.JButton();
		jLabel22 = new javax.swing.JLabel();
		jLabel23 = new javax.swing.JLabel();
		jTextField8 = new javax.swing.JTextField();
		jTextField10 = new javax.swing.JTextField();
		jLabel1 = new javax.swing.JLabel();
		jLabel2 = new javax.swing.JLabel();
		jPasswordField1 = new javax.swing.JPasswordField();
		jLabel3 = new javax.swing.JLabel();
		jLabel4 = new javax.swing.JLabel();
		jPasswordField2 = new javax.swing.JPasswordField();
		jLabel5 = new javax.swing.JLabel();
		jTextField1 = new javax.swing.JTextField();
		jLabel6 = new javax.swing.JLabel();
		jTextField2 = new javax.swing.JTextField();
		jButton1 = new javax.swing.JButton();
		jButton2 = new javax.swing.JButton();

		javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
		jPanel1.setLayout(jPanel1Layout);
		jPanel1Layout.setHorizontalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 95, Short.MAX_VALUE));
		jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 74, Short.MAX_VALUE));

		setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
		setTitle("\u4fee\u6539");

		jTabbedPane1.setTabPlacement(SwingConstants.LEFT);

		jLabel7.setText("\u6635\u79f0\uff1a");

		jLabel8.setText("\u6027\u522b\uff1a");

		jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "女", "男" }));

		jLabel9.setText("\u751f\u65e5\uff1a");

		jTextField4.addActionListener(new java.awt.event.ActionListener() {
			@Override
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				jTextField4ActionPerformed(evt);
			}
		});

		jLabel10.setText("\u5e74");

		jLabel11.setText("\u6708");

		jLabel12.setText("\u65e5");

		jLabel13.setText("\u7231\u597d\uff1a");

		jCheckBox1.setText("\u770b\u5c0f\u8bf4");

		jCheckBox2.setText("\u65c5\u6e38");

		jCheckBox3.setText("\u97f3\u4e50");

		jCheckBox4.setText("\u8fd0\u52a8");

		jCheckBox5.setText("\u5176\u5b83");

		jLabel14.setText("\u8840\u578b\uff1a");

		jLabel15.setText("\u578b");

		jLabel16.setText("\u661f\u5ea7\uff1a");

		jLabel17.setText("\u6240\u5728\u57ce\u5e02\uff1a");

		jLabel18.setText("\u7701");

		jLabel19.setText("\u5e02");

		jLabel20.setText("\u90ae\u7bb1\u5730\u5740\uff1a");

		jLabel21.setText("\u4e2a\u4eba\u8bf4\u660e\uff1a");

		jTextArea1.setColumns(20);
		jTextArea1.setRows(5);
		jScrollPane1.setViewportView(jTextArea1);

		jButton3.setText("\u786e\u5b9a");
		jButton3.addActionListener(new java.awt.event.ActionListener() {
			@Override
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				jButton3ActionPerformed(evt);
			}
		});
		jButton4.setText("\u91cd\u7f6e");
		jButton4.addActionListener(new java.awt.event.ActionListener() {
			@Override
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				jButton4ActionPerformed(evt);
			}
		});

		jLabel22.setText("\u7528\u6237\u540d\uff1a");

		jLabel23.setText("jLabel23");

		javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
		jPanel3.setLayout(jPanel3Layout);
		jPanel3Layout.setHorizontalGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(
				jPanel3Layout
						.createSequentialGroup()
						.addContainerGap()
						.addGroup(
								jPanel3Layout
										.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
										.addGroup(
												jPanel3Layout
														.createSequentialGroup()
														.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING).addComponent(jLabel21).addComponent(jLabel20).addComponent(jLabel14).addComponent(jLabel17).addComponent(jLabel13).addComponent(jLabel9).addComponent(jLabel8).addComponent(jLabel7).addComponent(jLabel22))
														.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
														.addGroup(
																jPanel3Layout
																		.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
																		.addGroup(
																				jPanel3Layout
																						.createSequentialGroup()
																						.addGap(4, 4, 4)
																						.addGroup(
																								jPanel3Layout
																										.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
																										.addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, 74, javax.swing.GroupLayout.PREFERRED_SIZE)
																										.addGroup(
																												jPanel3Layout
																														.createSequentialGroup()
																														.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																														.addGroup(
																																jPanel3Layout
																																		.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
																																		.addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
																																		.addGroup(
																																				jPanel3Layout.createSequentialGroup().addComponent(jTextField4, javax.swing.GroupLayout.PREFERRED_SIZE, 32, javax.swing.GroupLayout.PREFERRED_SIZE).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(jLabel10).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(jTextField5, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(jLabel11).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																																						.addComponent(jTextField6, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE).addGap(4, 4, 4).addComponent(jLabel12))))))
																		.addGroup(jPanel3Layout.createSequentialGroup().addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(jLabel23))
																		.addGroup(
																				jPanel3Layout
																						.createSequentialGroup()
																						.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
																						.addGroup(
																								jPanel3Layout
																										.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
																										.addGroup(
																												jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false).addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel3Layout.createSequentialGroup().addComponent(jComboBox3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED).addComponent(jLabel18).addGap(18, 18, 18).addComponent(jTextField10).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(jLabel19))
																														.addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel3Layout.createSequentialGroup().addComponent(jTextField7, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(jLabel15).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED).addComponent(jLabel16).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(jTextField8, javax.swing.GroupLayout.PREFERRED_SIZE, 69, javax.swing.GroupLayout.PREFERRED_SIZE)))
																										.addGroup(
																												jPanel3Layout
																														.createSequentialGroup()
																														.addGroup(
																																jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(jPanel3Layout.createSequentialGroup().addComponent(jCheckBox1).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(jCheckBox2).addGap(8, 8, 8).addComponent(jCheckBox3))
																																		.addGroup(jPanel3Layout.createSequentialGroup().addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE).addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))).addGap(7, 7, 7)
																														.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(jButton4, javax.swing.GroupLayout.PREFERRED_SIZE, 88, javax.swing.GroupLayout.PREFERRED_SIZE).addGroup(jPanel3Layout.createSequentialGroup().addComponent(jCheckBox4).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addComponent(jCheckBox5)))))))).addGroup(jPanel3Layout.createSequentialGroup().addGap(64, 64, 64).addComponent(jTextField9, javax.swing.GroupLayout.PREFERRED_SIZE, 122, javax.swing.GroupLayout.PREFERRED_SIZE))).addGap(197, 197, 197)));
		jPanel3Layout.setVerticalGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(
				jPanel3Layout.createSequentialGroup().addContainerGap().addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE).addComponent(jLabel23).addComponent(jLabel22)).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE).addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE).addComponent(jLabel7)).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
						.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE).addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE).addComponent(jLabel8)).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
						.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE).addComponent(jTextField4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE).addComponent(jLabel10).addComponent(jTextField5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE).addComponent(jLabel11).addComponent(jTextField6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE).addComponent(jLabel12).addComponent(jLabel9)).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
						.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE).addComponent(jCheckBox3).addComponent(jCheckBox4).addComponent(jCheckBox5).addComponent(jLabel13).addComponent(jCheckBox1).addComponent(jCheckBox2)).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE).addComponent(jTextField7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE).addComponent(jLabel15).addComponent(jLabel16).addComponent(jLabel14).addComponent(jTextField8, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)).addGap(9, 9, 9)
						.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE).addComponent(jComboBox3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE).addComponent(jLabel18).addComponent(jLabel17).addComponent(jLabel19).addComponent(jTextField10, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE).addComponent(jTextField9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE).addComponent(jLabel20))
						.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED).addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 88, javax.swing.GroupLayout.PREFERRED_SIZE).addComponent(jLabel21)).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 16, Short.MAX_VALUE).addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE).addComponent(jButton3, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE).addComponent(jButton4, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)).addGap(30, 30, 30)));

		jTabbedPane1.addTab("\u4e2a\u4eba\u8d44\u6599", jPanel3);

		jLabel1.setText("\u7528\u6237\u540d\uff1a");

		jLabel2.setText("\u65e7\u5bc6\u7801\uff1a");

		jPasswordField1.addActionListener(new java.awt.event.ActionListener() {
			@Override
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				jPasswordField1ActionPerformed(evt);
			}
		});

		jLabel3.setText("jLabel3");

		jLabel4.setText("\u65b0\u5bc6\u7801\uff1a");

		jLabel5.setText("\u5bc6\u7801\u63d0\u95ee\uff1a");

		jLabel6.setText("\u5bc6\u7801\u7b54\u6848\uff1a");

		jButton1.setText("\u4fee\u6539");
		jButton1.addActionListener(new java.awt.event.ActionListener() {
			@Override
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				jButton1ActionPerformed(evt);
			}
		});

		jButton2.setText("\u91cd\u7f6e");
		jButton2.addActionListener(new java.awt.event.ActionListener() {
			@Override
			public void actionPerformed(java.awt.event.ActionEvent evt) {
				jButton2ActionPerformed(evt);
			}
		});

		javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
		jPanel2.setLayout(jPanel2Layout);
		jPanel2Layout.setHorizontalGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(
				jPanel2Layout
						.createSequentialGroup()
						.addGap(53, 53, 53)
						.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING).addComponent(jLabel5).addComponent(jLabel2).addComponent(jLabel1).addComponent(jLabel4).addComponent(jLabel6))
						.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
						.addGroup(
								jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup().addComponent(jButton1, javax.swing.GroupLayout.DEFAULT_SIZE, 78, Short.MAX_VALUE).addGap(18, 18, 18).addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 77, javax.swing.GroupLayout.PREFERRED_SIZE)).addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false).addComponent(jLabel3).addComponent(jPasswordField1, javax.swing.GroupLayout.DEFAULT_SIZE, 173, Short.MAX_VALUE).addComponent(jPasswordField2)).addComponent(jTextField2, javax.swing.GroupLayout.DEFAULT_SIZE, 173, Short.MAX_VALUE)
										.addComponent(jTextField1, javax.swing.GroupLayout.DEFAULT_SIZE, 173, Short.MAX_VALUE)).addGap(296, 296, 296)));
		jPanel2Layout.setVerticalGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGroup(
				jPanel2Layout.createSequentialGroup().addGap(27, 27, 27).addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE).addComponent(jLabel1).addComponent(jLabel3)).addGap(18, 18, 18).addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE).addComponent(jLabel2).addComponent(jPasswordField1, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)).addGap(18, 18, 18).addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE).addComponent(jLabel4).addComponent(jPasswordField2, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE)).addGap(18, 18, 18)
						.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE).addComponent(jLabel5).addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)).addGap(18, 18, 18).addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE).addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE).addComponent(jLabel6)).addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 48, Short.MAX_VALUE)
						.addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE).addComponent(jButton1, javax.swing.GroupLayout.DEFAULT_SIZE, 33, Short.MAX_VALUE).addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE)).addGap(115, 115, 115)));

		jTabbedPane1.addTab("\u5b89\u5168\u8bbe\u7f6e", jPanel2);

		javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
		getContentPane().setLayout(layout);
		layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 523, Short.MAX_VALUE));
		layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 397, Short.MAX_VALUE));

		pack();
	}// </editor-fold>
		// GEN-END:initComponents
	public void initInfo(String id, boolean juggle) {
		if (id == null || id.equals("*")) {
			return;
		}
		this.id = id;

		MainWindows.getInstance().client.send("<update cmd=\"get\" userid=\"" + id + "\" />");

		this.myinfo = juggle;

		jButton1.setVisible(juggle);
		jButton2.setVisible(juggle);
		jButton3.setVisible(juggle);
		jButton4.setVisible(juggle);

	}
	private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
		String pwd = new String(jPasswordField1.getPassword());
		String pwdnew = new String(jPasswordField2.getPassword());
		String Tiwen = jTextField1.getText();
		String daan = jTextField2.getText();

		StringBuffer sb = new StringBuffer("<update cmd=\"pwd\" ");
		sb.append("userid=\"").append(id).append("\" ");
		sb.append("pwdold=\"").append(pwd).append("\" ");
		sb.append("pwdnew=\"").append(pwdnew).append("\" ");
		sb.append("tiwen=\"").append(Tiwen).append("\" ");
		sb.append("daan=\"").append(daan).append("\" ");
		sb.append("/>");

		MainWindows.getInstance().client.send(sb);
		jButton1.setEnabled(false);
//		db.isUpdate(pwd, Tiwen, daan, id);
	}
	private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
		// TODO add your handling code here:
		jPasswordField1.setText("");
		jPasswordField2.setText("");
		jTextField1.setText("");
		jTextField2.setText("");

	}
	private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {
		StringBuffer sb = new StringBuffer("<update cmd=\"info\" ");
		sb.append("userid=\"").append(id).append("\" ");
		sb.append("name=\"").append(jTextField3.getText()).append("\" ");
		sb.append("sex=\"").append(jComboBox1.getSelectedIndex() == 1 ? "男" : "女").append("\" ");
		sb.append("birthday=\"").append(new Date(Integer.parseInt(jTextField4.getText()), Integer.parseInt(jTextField5.getText()), Integer.parseInt(jTextField6.getText())).getTime()).append("\" ");
		sb.append("aihao=\"").append(jCheckBox1.isSelected() ? "看小说" : "").append(jCheckBox2.isSelected() ? "旅游" : "").append(jCheckBox3.isSelected() ? "音乐" : "").append(jCheckBox3.isSelected() ? "运动" : "").append(jCheckBox3.isSelected() ? "其它" : "").append("\" ");
		sb.append("blood=\"").append(jTextField7.getText()).append("\" ");
		sb.append("xinzuo=\"").append(jTextField8.getText()).append("\" ");
		sb.append("province=\"").append(jComboBox3.getSelectedIndex() + 1).append("\" ");
		sb.append("city=\"").append(jTextField10.getText()).append("\" ");
		sb.append("email=\"").append(jTextField9.getText()).append("\" ");
		sb.append(">");
		sb.append(jTextArea1.getText());
		sb.append("</update>");

		MainWindows.getInstance().client.send(sb);

		jButton3.setEnabled(false);

	}
	private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {
		// TODO add your handling code here:
		jTextField3.setText("");
		jTextField4.setText("");
		jTextField5.setText("");
		jTextField5.setText("");
		jCheckBox1.setSelected(false);
		jCheckBox2.setSelected(false);
		jCheckBox3.setSelected(false);
		jCheckBox4.setSelected(false);
		jCheckBox5.setSelected(false);
		jTextField6.setText("");
		jTextField7.setText("");
		// jTextField8.setText("");
		jTextField9.setText("");
		jTextArea1.setText("");
	}
	private void jPasswordField1ActionPerformed(java.awt.event.ActionEvent evt) {
		// TODO add your handling code here:
	}

	// End of variables declaration//GEN-END:variables

	private void jTextField4ActionPerformed(java.awt.event.ActionEvent evt) {
		// TODO add your handling code here:
	}

	@Override
	public void onCloseEvent(Client.CloseEvent cce) {
		// TODO Auto-generated method stub

	}

	@Override
	public void onMsgEvent(MsgEvent ce) {
		if ("zhuce".equals(ce.getCmd().FLAG)) {
			if (ce.getCmd().get("cmd").equals("shen") && ce.getCmd().get("update").equals("true")) {
				List<String> rs = Arrays.asList(ce.getCmd().get("value").toString().split(","));
				try {
					for (String shen : rs) {
						jComboBox3.addItem(shen);
					}
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		} else if ("update".equals(ce.getCmd().FLAG) && "get".equals(ce.getCmd().get("cmd"))) {
			String value = ce.getCmd().get("value");
			if (value != null) {
				String[] arr = value.split(",");
				// 安全设置
				jPasswordField1.setText("");
				if (myinfo) {
					jTextField1.setText(arr[0]);
					jTextField2.setText(arr[1]);
				} else {
					jPanel2.setVisible(false);
				}
				// 个人资料
				jTextField3.setText(arr[2]);
				String s = arr[3];
				jComboBox1.setSelectedIndex(s.equals("男") ? 1 : 0);
				Date Birthday = new Date(Long.parseLong(arr[4]));
				jTextField4.setText(String.valueOf(Birthday.getYear() + 1900));
				jTextField5.setText(String.valueOf(Birthday.getMonth() + 1));
				jTextField6.setText(String.valueOf(Birthday.getDate()));
				String a = arr[5];
				if (a.indexOf("看小说") != -1) {
					jCheckBox1.setSelected(true);
				}
				if (a.indexOf("旅游") != -1) {
					jCheckBox2.setSelected(true);
				}
				if (a.indexOf("音乐") != -1) {
					jCheckBox3.setSelected(true);
				}
				if (a.indexOf("运动") != -1) {
					jCheckBox4.setSelected(true);
				}
				if (a.indexOf("其它") != -1) {
					jCheckBox5.setSelected(true);
				}
				int i = 0;
				try {
					i = Integer.parseInt(arr[8]);
				} catch (Exception e) {
				}
				jTextField7.setText(arr[6]);
				jTextField8.setText(arr[7]);
				jComboBox3.setSelectedIndex(i - 1);
				jTextField10.setText(arr[9]);
				jTextField9.setText(arr[10]);
				jTextArea1.setText(arr.length > 11 ? arr[11] : "");
				jLabel3.setText(id);
				jLabel23.setText(id);

			}
			this.setVisible(true);
		} else if ("update".equals(ce.getCmd().FLAG) && "pwd".equals(ce.getCmd().get("cmd"))) {
			jButton1.setEnabled(true);
			if ("true".equals(ce.getCmd().get("result"))) {
				JOptionPane.showMessageDialog(null, "恭喜，修改密码信息成功！");
			} else {
				JOptionPane.showMessageDialog(null, "对不起，修改密码信息失败！");
			}
		} else if ("update".equals(ce.getCmd().FLAG) && "info".equals(ce.getCmd().get("cmd"))) {
			jButton3.setEnabled(true);
			if ("true".equals(ce.getCmd().get("result"))) {
				JOptionPane.showMessageDialog(null, "恭喜，修改用户信息成功！");
				setVisible(false);
			} else {
				JOptionPane.showMessageDialog(null, "对不起，修改用户信息失败！");
			}
		}
	}

}